/**
 * The PacketType enum
 *
 * @author  Jill San Luis
 */
public enum PacketType {

    REQUEST(1),
    REPLY(2);
    private int type;

    /**
     * Creates a new instance of PacketType.
     */
    private PacketType(int type) {
        this.type = type;
    }

    public int getType() {
        return type;
    }

    public static PacketType getPacketType(int type) {

        for (PacketType pt : PacketType.values()) {
            if (pt.getType() == type) {
                return pt;
            }
        }
        return null;
    }
}
